import 'package:flutter/material.dart';
import 'package:flutter_ncsjqz_getx/init/init_app.dart';
import 'package:flutter_ncsjqz_getx/widget/ink_widget.dart';
import 'package:get/get.dart';

import 'loading_logic.dart';

/// <summary>
/// author：zwb
/// dateTime： 2022/1/4 13:45
/// filePath： lib/page/loading/loading_view.dart
/// desc: 启动图 闪屏页
/// <summary>
///
class LoadingPage extends StatefulWidget {
  @override
  _LoadingPageState createState() => _LoadingPageState();
}

class _LoadingPageState extends State<LoadingPage> {
  final LoadingLogic logic = Get.put(LoadingLogic());

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    InitApp.initSdkManagement();
    logic.setOldTimer();
  }

  @override
    Widget build(BuildContext context) {
      return GetBuilder<LoadingLogic>(
        builder: (controller) {
          return Scaffold(
            body: Stack(
              children: [
                InkWidget.imgAsset("sp.png",fit: BoxFit.fill,width: Get.width,height: Get.height,),
                Positioned(
                    top: 80,
                    right: 20,
                    child: OutlineButton(
                      child: Text("倒计时${logic.newCount}s",style: TextStyle(color: Colors.green,fontSize: 16,fontWeight: FontWeight.bold),),
                      shape: StadiumBorder(),
                      borderSide: BorderSide(color: Colors.green,width: 1.3),
                      onPressed: (){

                      },
                    )
                ),
              ],
            ),
          );
        },
      );
    }

  @override
  void dispose() {
    Get.delete<LoadingLogic>();
    super.dispose();
  }
}